package org.ccay.security.config;

import org.ccay.core.ioc.Ccay;
import org.ccay.security.dimension.DimensionDataProvider;
import org.springframework.util.Assert;


public class DimensionDefineConfig {
	
	/**
	 * 维度显示名称
	 */
	private String dimensionDisplayName;
	
	/**
	 * 维度名称
	 */
	private String dimensionName;
	
	/**
	 * 维度值的类型
	 */
	private Class<?> dimensionValueType;
	
	/**
	 * 维度可选值提供者
	 */
	private DimensionDataProvider dataProvider;
	
	/**
	 * 维度数据提供者名称
	 */
	private String dataProviderBeanName;
	

	public DimensionDataProvider getDataProvider() {
		if(null == dataProvider){
			Assert.notNull(dataProviderBeanName);
			dataProvider = Ccay.getContext().getBean(dataProviderBeanName,DimensionDataProvider.class);
		}
		return dataProvider;
	}

	public void setDataProvider(DimensionDataProvider dataProvider) {
		this.dataProvider = dataProvider;
	}

	public String getDimensionName() {
		return dimensionName;
	}

	public void setDimensionName(String dimensionName) {
		this.dimensionName = dimensionName;
	}


	public String getDimensionDisplayName() {
		return dimensionDisplayName;
	}

	public void setDimensionDisplayName(String dimensionDisplayName) {
		this.dimensionDisplayName = dimensionDisplayName;
	}

	public Class<?> getDimensionValueType() {
		return dimensionValueType;
	}

	public void setDimensionValueType(Class<?> dimensionValueType) {
		this.dimensionValueType = dimensionValueType;
	}

	public String getDataProviderBeanName() {
		return dataProviderBeanName;
	}

	public void setDataProviderBeanName(String dataProviderBeanName) {
		this.dataProviderBeanName = dataProviderBeanName;
	}
	
}
